﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;

namespace DuoMi.MallCustomerService.Web.Controls.Portal
{
    /// <summary>
    /// LoginVerify1 的摘要说明
    /// </summary>
    public class LoginVerify1 : IHttpHandler, IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            bool isLogin = true;
            try
            {
                if (string.IsNullOrEmpty(context.Session["AdminId"] as String) || string.IsNullOrEmpty(context.Session["AdminName"] as String))
                {
                    isLogin = false;
                }
            }
            catch (Exception)
            {
                isLogin = false;
            }

            if (!isLogin)
            {
                context.Response.Write("<script language='javascript'>top.location.href ='/Admin/Default.aspx';</script>");
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}